<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Rake::TaskManager - rake: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-5B-5D">#[]</a>
    <li ><a href="#method-i-add_location">#add_location</a>
    <li ><a href="#method-i-attempt_rule">#attempt_rule</a>
    <li ><a href="#method-i-clear">#clear</a>
    <li ><a href="#method-i-current_scope">#current_scope</a>
    <li ><a href="#method-i-enhance_with_matching_rule">#enhance_with_matching_rule</a>
    <li ><a href="#method-i-find_location">#find_location</a>
    <li ><a href="#method-i-generate_did_you_mean_suggestions">#generate_did_you_mean_suggestions</a>
    <li ><a href="#method-i-generate_message_for_undefined_task">#generate_message_for_undefined_task</a>
    <li ><a href="#method-i-generate_name">#generate_name</a>
    <li ><a href="#method-i-get_description">#get_description</a>
    <li ><a href="#method-i-in_namespace">#in_namespace</a>
    <li ><a href="#method-i-intern">#intern</a>
    <li ><a href="#method-i-lookup">#lookup</a>
    <li ><a href="#method-i-lookup_in_scope">#lookup_in_scope</a>
    <li ><a href="#method-i-make_sources">#make_sources</a>
    <li ><a href="#method-i-resolve_args">#resolve_args</a>
    <li ><a href="#method-i-resolve_args_without_dependencies">#resolve_args_without_dependencies</a>
    <li ><a href="#method-i-tasks">#tasks</a>
    <li ><a href="#method-i-tasks_in_scope">#tasks_in_scope</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Rake::TaskManager">
    <h1 id="module-Rake::TaskManager" class="module">
      module Rake::TaskManager
    </h1>

    <section class="description">
    
<p>The <a href="TaskManager.html"><code>TaskManager</code></a> module is a mixin for managing tasks.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-last_description" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">last_description</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Track the last comment made in the Rakefile.</p>
              </div>
            </div>
            </section>


                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-5B-5D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">[]</span><span
                                class="method-args">(task_name, scopes=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Find a matching task for <code>task_name</code>.</p>

                              <div class="method-source-code" id="5B-5D-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 54</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">[]</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">scopes</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">task_name</span> = <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">scopes</span>) <span class="ruby-keyword">or</span>
    <span class="ruby-identifier">enhance_with_matching_rule</span>(<span class="ruby-identifier">task_name</span>) <span class="ruby-keyword">or</span>
    <span class="ruby-identifier">synthesize_file_task</span>(<span class="ruby-identifier">task_name</span>) <span class="ruby-keyword">or</span>
    <span class="ruby-identifier">fail</span> <span class="ruby-identifier">generate_message_for_undefined_task</span>(<span class="ruby-identifier">task_name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Clear all tasks in this application.</p>

                              <div class="method-source-code" id="clear-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 182</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear</span>
  <span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-ivar">@rules</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_scope" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_scope</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return the list of scope names currently active in the task manager.</p>

                              <div class="method-source-code" id="current_scope-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 222</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_scope</span>
  <span class="ruby-ivar">@scope</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-enhance_with_matching_rule" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">enhance_with_matching_rule</span><span
                                class="method-args">(task_name, level=0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>If a rule can be found that matches the task name, enhance the task with the prerequisites and actions from the rule.  Set the source attribute of the task appropriately for the rule.  Return the enhanced task or nil of no rule was found.</p>

                              <div class="method-source-code" id="enhance_with_matching_rule-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 151</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">enhance_with_matching_rule</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">level</span>=<span class="ruby-value">0</span>)
  <span class="ruby-identifier">fail</span> <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">RuleRecursionOverflowError</span>,
    <span class="ruby-string">&quot;Rule Recursion Too Deep&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">level</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">16</span>
  <span class="ruby-ivar">@rules</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">extensions</span>, <span class="ruby-identifier">order_only</span>, <span class="ruby-identifier">block</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">pattern</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">task_name</span>)
      <span class="ruby-identifier">task</span> = <span class="ruby-identifier">attempt_rule</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">extensions</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">level</span>)
      <span class="ruby-identifier">task</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">order_only</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">order_only</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-keyword">return</span> <span class="ruby-identifier">task</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">task</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">RuleRecursionOverflowError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">ex</span>
  <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">add_target</span>(<span class="ruby-identifier">task_name</span>)
  <span class="ruby-identifier">fail</span> <span class="ruby-identifier">ex</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_did_you_mean_suggestions" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_did_you_mean_suggestions</span><span
                                class="method-args">(task_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_did_you_mean_suggestions-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_did_you_mean_suggestions</span>(<span class="ruby-identifier">task_name</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span><span class="ruby-operator">::</span><span class="ruby-constant">SpellChecker</span>)

  <span class="ruby-identifier">suggestions</span> = <span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span><span class="ruby-operator">::</span><span class="ruby-constant">SpellChecker</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">dictionary:</span> <span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">keys</span>).<span class="ruby-identifier">correct</span>(<span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">to_s</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:formatter</span>)<span class="ruby-comment"># did_you_mean v1.2.0 or later</span>
    <span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span>.<span class="ruby-identifier">formatter</span>.<span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">suggestions</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatter</span>) <span class="ruby-comment"># before did_you_mean v1.2.0</span>
    <span class="ruby-operator">::</span><span class="ruby-constant">DidYouMean</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">suggestions</span>).<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-string">&quot;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_message_for_undefined_task" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_message_for_undefined_task</span><span
                                class="method-args">(task_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_message_for_undefined_task-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 62</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_message_for_undefined_task</span>(<span class="ruby-identifier">task_name</span>)
  <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Don&#39;t know how to build task &#39;#{task_name}&#39; &quot;</span>\
            <span class="ruby-node">&quot;(See the list of available tasks with `#{Rake.application.name} --tasks`)&quot;</span>
  <span class="ruby-identifier">message</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">generate_did_you_mean_suggestions</span>(<span class="ruby-identifier">task_name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-in_namespace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">in_namespace</span><span
                                class="method-args">(name) { |ns| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Evaluate the block in a nested namespace named <code>name</code>.  Create an anonymous namespace if <code>name</code> is nil.</p>

                              <div class="method-source-code" id="in_namespace-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 228</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">in_namespace</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">generate_name</span>
  <span class="ruby-ivar">@scope</span> = <span class="ruby-constant">Scope</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-ivar">@scope</span>)
  <span class="ruby-identifier">ns</span> = <span class="ruby-constant">NameSpace</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@scope</span>)
  <span class="ruby-keyword">yield</span>(<span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">ns</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@scope</span> = <span class="ruby-ivar">@scope</span>.<span class="ruby-identifier">tail</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-intern" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">intern</span><span
                                class="method-args">(task_class, task_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Lookup a task.  Return an existing task if found, otherwise create a task of the current type.</p>

                              <div class="method-source-code" id="intern-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 49</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intern</span>(<span class="ruby-identifier">task_class</span>, <span class="ruby-identifier">task_name</span>)
  <span class="ruby-ivar">@tasks</span>[<span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">task_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-keyword">self</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lookup" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lookup</span><span
                                class="method-args">(task_name, initial_scope=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Lookup a task, using scope and the scope hints in the task name. This method performs straight lookups without trying to synthesize file tasks or rules.  Special scope names (e.g. ‘^’) are recognized.  If no scope argument is supplied, use the current scope.  Return nil if the task cannot be found.</p>

                              <div class="method-source-code" id="lookup-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 192</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lookup</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">initial_scope</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">initial_scope</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@scope</span>
  <span class="ruby-identifier">task_name</span> = <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">task_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^rake:/</span>
    <span class="ruby-identifier">scopes</span> = <span class="ruby-constant">Scope</span>.<span class="ruby-identifier">make</span>
    <span class="ruby-identifier">task_name</span> = <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^rake:/</span>, <span class="ruby-string">&quot;&quot;</span>)
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">task_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^(\^+)/</span>
    <span class="ruby-identifier">scopes</span> = <span class="ruby-identifier">initial_scope</span>.<span class="ruby-identifier">trim</span>(<span class="ruby-node">$1</span>.<span class="ruby-identifier">size</span>)
    <span class="ruby-identifier">task_name</span> = <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^(\^+)/</span>, <span class="ruby-string">&quot;&quot;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">scopes</span> = <span class="ruby-identifier">initial_scope</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">lookup_in_scope</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">scopes</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_args" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_args</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resolve the arguments for a task/rule.  Returns a tuple of [task_name, arg_name_list, prerequisites, order_only_prerequisites].</p>

                              <div class="method-source-code" id="resolve_args-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_args</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
    <span class="ruby-identifier">deps</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>
    <span class="ruby-identifier">resolve_args_with_dependencies</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">deps</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">resolve_args_without_dependencies</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tasks" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tasks</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>List of all defined tasks in this application.</p>

                              <div class="method-source-code" id="tasks-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 168</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tasks</span>
  <span class="ruby-ivar">@tasks</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort_by</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tasks_in_scope" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tasks_in_scope</span><span
                                class="method-args">(scope)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>List of all the tasks defined in the given scope (and its sub-scopes).</p>

                              <div class="method-source-code" id="tasks_in_scope-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 174</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tasks_in_scope</span>(<span class="ruby-identifier">scope</span>)
  <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">scope</span>.<span class="ruby-identifier">path</span>
  <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
    <span class="ruby-regexp">/^#{prefix}:/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-add_location" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_location</span><span
                                class="method-args">(task)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add a location to the locations field of the given task.</p>

                              <div class="method-source-code" id="add_location-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 241</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_location</span>(<span class="ruby-identifier">task</span>)
  <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">find_location</span>
  <span class="ruby-identifier">task</span>.<span class="ruby-identifier">locations</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">loc</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">loc</span>
  <span class="ruby-identifier">task</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-attempt_rule" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">attempt_rule</span><span
                                class="method-args">(task_name, task_pattern, args, extensions, block, level)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Attempt to create a rule given the list of prerequisites.</p>

                              <div class="method-source-code" id="attempt_rule-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 271</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">attempt_rule</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">task_pattern</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">extensions</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">level</span>)
  <span class="ruby-identifier">sources</span> = <span class="ruby-identifier">make_sources</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">task_pattern</span>, <span class="ruby-identifier">extensions</span>)
  <span class="ruby-identifier">prereqs</span> = <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">source</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">trace_rule</span> <span class="ruby-identifier">level</span>, <span class="ruby-node">&quot;Attempting Rule #{task_name} =&gt; #{source}&quot;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">source</span>) <span class="ruby-operator">||</span> <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">Task</span>.<span class="ruby-identifier">task_defined?</span>(<span class="ruby-identifier">source</span>)
      <span class="ruby-identifier">trace_rule</span> <span class="ruby-identifier">level</span>, <span class="ruby-node">&quot;(#{task_name} =&gt; #{source} ... EXIST)&quot;</span>
      <span class="ruby-identifier">source</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">enhance_with_matching_rule</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">level</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
      <span class="ruby-identifier">trace_rule</span> <span class="ruby-identifier">level</span>, <span class="ruby-node">&quot;(#{task_name} =&gt; #{source} ... ENHANCE)&quot;</span>
      <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">name</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">trace_rule</span> <span class="ruby-identifier">level</span>, <span class="ruby-node">&quot;(#{task_name} =&gt; #{source} ... FAIL)&quot;</span>
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  }
  <span class="ruby-identifier">task</span> = <span class="ruby-constant">FileTask</span>.<span class="ruby-identifier">define_task</span>(<span class="ruby-identifier">task_name</span>, { <span class="ruby-identifier">args</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">prereqs</span> }, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">task</span>.<span class="ruby-identifier">sources</span> = <span class="ruby-identifier">prereqs</span>
  <span class="ruby-identifier">task</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-find_location" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">find_location</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Find the location that called into the dsl layer.</p>

                              <div class="method-source-code" id="find_location-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 248</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_location</span>
  <span class="ruby-identifier">locations</span> = <span class="ruby-identifier">caller</span>
  <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
  <span class="ruby-keyword">while</span> <span class="ruby-identifier">locations</span>[<span class="ruby-identifier">i</span>]
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">locations</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">locations</span>[<span class="ruby-identifier">i</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp">/rake\/dsl_definition.rb/</span>
    <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Generate an anonymous namespace name.</p>

                              <div class="method-source-code" id="generate_name-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 259</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_name</span>
  <span class="ruby-ivar">@seed</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
  <span class="ruby-ivar">@seed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-node">&quot;_anon_#{@seed}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_description" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_description</span><span
                                class="method-args">(task)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Return the current description, clearing it in the process.</p>

                              <div class="method-source-code" id="get_description-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 319</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_description</span>(<span class="ruby-identifier">task</span>)
  <span class="ruby-identifier">desc</span> = <span class="ruby-ivar">@last_description</span>
  <span class="ruby-ivar">@last_description</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">desc</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lookup_in_scope" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lookup_in_scope</span><span
                                class="method-args">(name, scope)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Lookup the task name</p>

                              <div class="method-source-code" id="lookup_in_scope-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 208</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lookup_in_scope</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">scope</span>)
  <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">tn</span> = <span class="ruby-identifier">scope</span>.<span class="ruby-identifier">path_with_task_name</span>(<span class="ruby-identifier">name</span>)
    <span class="ruby-identifier">task</span> = <span class="ruby-ivar">@tasks</span>[<span class="ruby-identifier">tn</span>]
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">task</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">task</span>
    <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">scope</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">scope</span> = <span class="ruby-identifier">scope</span>.<span class="ruby-identifier">tail</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-make_sources" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">make_sources</span><span
                                class="method-args">(task_name, task_pattern, extensions)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Make a list of sources from the list of file name extensions / translation procs.</p>

                              <div class="method-source-code" id="make_sources-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 293</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">make_sources</span>(<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">task_pattern</span>, <span class="ruby-identifier">extensions</span>)
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">extensions</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ext</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">ext</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/%/</span>
      <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">pathmap</span>(<span class="ruby-identifier">ext</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">%r{/}</span>
      <span class="ruby-identifier">ext</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^\./</span>
      <span class="ruby-identifier">source</span> = <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-identifier">task_pattern</span>, <span class="ruby-identifier">ext</span>)
      <span class="ruby-identifier">source</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">ext</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">task_name</span>.<span class="ruby-identifier">ext</span>(<span class="ruby-identifier">ext</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">source</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>, <span class="ruby-constant">Symbol</span>
      <span class="ruby-identifier">ext</span>.<span class="ruby-identifier">to_s</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Proc</span>, <span class="ruby-constant">Method</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">ext</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
        <span class="ruby-identifier">ext</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">task_name</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">ext</span>.<span class="ruby-identifier">call</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail</span> <span class="ruby-node">&quot;Don&#39;t know how to handle rule dependent: #{ext.inspect}&quot;</span>
    <span class="ruby-keyword">end</span>
  }
  <span class="ruby-identifier">result</span>.<span class="ruby-identifier">flatten</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_args_without_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_args_without_dependencies</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Resolve task arguments for a task or rule when there are no dependencies declared.</p>

<p>The patterns recognized by this argument resolving function are:</p>

<pre class="ruby"><span class="ruby-identifier">task</span> <span class="ruby-value">:t</span>
<span class="ruby-identifier">task</span> <span class="ruby-value">:t</span>, [<span class="ruby-value">:a</span>]
</pre>

                              <div class="method-source-code" id="resolve_args_without_dependencies-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/task_manager.rb, line 105</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_args_without_dependencies</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">task_name</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">shift</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_ary</span>)
    <span class="ruby-identifier">arg_names</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">to_ary</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">arg_names</span> = <span class="ruby-identifier">args</span>
  <span class="ruby-keyword">end</span>
  [<span class="ruby-identifier">task_name</span>, <span class="ruby-identifier">arg_names</span>, [], <span class="ruby-keyword">nil</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

